<template>
    <div class="box">
        <header class="header">
            <van-search placeholder="请输入搜索关键词" @click-input="$router.push('/search')" />
        </header>
        <div class="content">
            <van-swipe :autoplay="3000" lazy-render>
                <van-swipe-item v-for="image in images" :key="image">
                    <img :src="image" />
                </van-swipe-item>
            </van-swipe>
            <!-- <van-grid>
                <van-grid-item
                    icon="https://m15.360buyimg.com/mobilecms/jfs/t1/187640/12/30456/5256/639c2315Ebc95c142/350a8f0c766f5460.png"
                    text="京东超市" />
                <van-grid-item icon="photo-o" text="文字" />
                <van-grid-item icon="photo-o" text="文字" />
                <van-grid-item icon="photo-o" text="文字" />
            </van-grid> -->
            <div style="padding:4px">
                <div class="banner">
                    <div class="title">
                        京东秒杀
                    </div>

                    <div class="slide-box">
                        <div class="slide" :style="{ width: 8 * 100 + 'px' }">
                            <div class="slide-item" v-for="n in 8">
                                <img src="https://picsum.photos/200" class="slide-img">
                                <div>¥10{{ n }}</div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <Prolist />
        </div>
    </div>
</template>
<script>
import Prolist from './components/Prolist.vue'
export default {
    components: {
        Prolist
    },
    data() {
        return {
            images: [
                'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
                'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
            ],
        }
    }
}
</script>
<style lang="scss" scoped>
img {
    width: 100%;
    height: 200px;
}

.banner {
    width: 100%;
    height: 100px;
    border: 2px solid rgb(226, 70, 70);
    position: relative;
    border-radius: 10px;

    .title {
        position: absolute;
        left: 0;
        top: 0;
        width: 70px;
        height: 100px;
        background-color: rgb(226, 70, 70);
        color: #fff;
        line-height: 100px;
        text-align: center;
        font-size: 16px;
    }

    .slide-box {
        overflow-x: scroll;
        width: 100%;
        border-radius: 10px;
    }

    .slide-box::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .slide {
        padding-left: 70px;
        height: 100px;
        text-align: center;
        border-radius: 10px;
    }

    .slide-item {
        display: inline-block;
        padding-top: 5px;
        width: 100px;
        height: 100px;
        background-color: #fff;
    }

    .slide-img {
        width: 76px;
        height: 76px;
    }
}
</style>